package sg.edu.nus.iss.cerberus.engine;

import java.util.*;

/**
 * A class for JUnit4 assertion values of user defined methods.
 * */

public class JUnitMethodCheck {

	private ArrayList<String> assertions;

	/**
	 * A default constructor for JUnitMethodCheck object.
	 * */
	public JUnitMethodCheck() {
		this.assertions = new ArrayList<String>();
	}

	/**
	 * A parameterized constructor for JUnitMethodCheck object.
	 * 
	 * @param asserts the assertion values
	 * */
	public JUnitMethodCheck(ArrayList<String> asserts) {
		this.assertions = asserts;
	}

	/**
	 * A setter method for assertion values.
	 * 
	 * @param asserts the assertion values
	 * */
	public void setAssertions(ArrayList<String> assertions) {
		this.assertions = assertions;
	}

	/**
	 * A getter method for assertion values.
	 * 
	 * @return ArrayList<String>
	 * */
	public ArrayList<String> getAssertions() {
		return assertions;
	}

	/**
	 * A setter method for one specific assertion value.
	 * 
	 * @param assertion the assertion value
	 * */
	public void setValue(String assertion) {
		if (!assertions.contains(assertion))
			assertions.add(assertion);
	}

	/**
	 * A method for checking the assertion value is exist or not.
	 * 
	 * @param assertion the assertion name
	 * @return boolean true or false
	 * */
	public boolean isAssertExists(String assertion) {
		return assertions.contains(assertion);
	}
	
	/**
	 * A method for getting the assertion value.
	 * 
	 * @param assertion the assertion name
	 * @return boolean true or false
	 * */
	public boolean getValue(String assertion) {
		return assertions.contains(assertion);
	}

}
